<?php
namespace app\api\logic;
use think\Db;
/**
* 所有类别
*/
class Abouts
{
	/**
	* 导航也详情
	* @param $navuid array 子导航条件
	* @param $navid array 父级导航条件
	*/ 
	public function blocsList($where)
	{
			$blocsList=Db::name('NavDetail')->where($where)->find();
		if($blocsList){
			return $blocsList;
		}else{
			return false;
		}
	}
	/**
	* 子导航id
	*/ 
	public function blocsNavuid($where)
	{
		$blocsList=Db::name('ApiNavu')->where($where)->value('navuid');
		if($blocsList){
			return $blocsList;
		}else{
			return false;
		}
	}
	/**
	* 子导航信息
	*/
	public function blocsNavu($where)
	{
		$where['navutype']=1;
		$blocsNavu=Db::name('ApiNavu')->order('navuid asc')->where($where)->select();
		foreach ($blocsNavu as $key => $value) {
			$where['navid']=$blocsNavu[$key]['navuid'];
			$blocsNavu[$key]['navulist']=Db::name('ApiNavu')->where($where)->select();
			foreach ($blocsNavu[$key]['navulist'] as $k => $v) {
				$where['navid']=$blocsNavu[$key]['navulist'][$k]['navuid'];
				$blocsNavu[$key]['navulist'][$k]['navulists']=Db::name('ApiNavu')->where($where)->select();
			}
		}
		if($blocsNavu){
			return $blocsNavu;
		}else{
			return false;
		}
	}
	/**
	* 父级导航链接
	*/
	public function blocsNavHref($where)
	{
		$blocsNavHref=Db::name('ApiNav')->where($where)->find();
		if($blocsNavHref){
			return $blocsNavHref;
		}else{
			return false;
		}
	}
	/**
	* 子集名称
	*/
	public function navuname($where){
		$navuname=Db::name('ApiNavu')->where($where)->value('navuname');
		if($navuname){
			return $navuname;
		}else{
			return false;
		}
	} 
}